<!DOCTYPE html>
<html class="x-admin-sm">

<head>
	<meta charset="UTF-8">
	<title>电子学会比赛管理系统</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
	<link rel="stylesheet" href="./css/font.css">
	<link rel="stylesheet" href="./css/common.css">
	<link rel="stylesheet" href="./css/xadmin.css">

	<script type="text/javascript" src="./js/abkj/match/api/webinfo.js"></script>
	<script type="text/javascript" src="./js/abkj/fun_tool.js"></script>
	<script type="text/javascript" src="./js/abkj/slAjax.js"></script>
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>
<div class="x-nav">
	<span class="layui-breadcrumb">
			<a href="">首页</a>
			<a><cite>网站配置</cite></a>
			<a><cite>基本信息</cite></a>
	</span>
</div>
<div class="layui-fluid">
	<div class="layui-row layui-col-space15">
		<div class="layui-col-md12">
			<div class="layui-card" id="content" v-cloak style="padding: 30px 0">
				<form class="layui-form" @submit.prevent>
					<div class="layui-form-item">
						<label class="layui-form-label" >
							<span class="x-red">*</span>电话</label>
						</label>
						<div class="layui-input-inline">
							<input name="phone" id="phone" lay-reqtext="请输入电话" lay-verify="required" class="layui-input" type="text">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label" >
							<span class="x-red">*</span>邮箱</label>
						</label>
						<div class="layui-input-inline">
							<input name="email" id="email" lay-verify="email" class="layui-input" type="text">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"></label>
						<button class="layui-btn" lay-filter="confirm" lay-submit="" >确认修改</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script src="./js/jquery.min.js"></script>
<script src="./js/vue.js"></script>
<script>
	var app=new Vue({
		el: '#content',
		mounted: function () {
			layui.use('form', function () {
				var form = layui.form
				form.on('submit(confirm)', function (data) {
				  phone=document.getElementById('phone').value
					email=document.getElementById('email').value
					querydata={
						id:1,
						email:email,
						phone:phone,
					}
					WebInfoupdateById(querydata,function(data){
  				   // alert(JSON.stringify(data))
 					   alert("修改成功！")
						 location.reload()
  				})

				})
			})
		},
		methods:{
			 getdata:function(){
				 var id=1
				 WebInfogetObj(id,function(data){
 				   // alert(JSON.stringify(data))
					 document.getElementById('phone').value=data.phone
					 document.getElementById('email').value=data.email
 				})

			 }
		}

	})
	app.getdata()

</script>
</html>
